﻿<Page x:Class="PluginPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Views="clr-namespace:Xceed.Wpf.DataGrid.Views;assembly=Xceed.Wpf.DataGrid"
    xmlns:xcdg="clr-namespace:Xceed.Wpf.DataGrid;assembly=Xceed.Wpf.DataGrid"
    Title="PluginPage">
    <Page.BindingGroup>
        <BindingGroup />
    </Page.BindingGroup>
    <DockPanel>
        <StackPanel DockPanel.Dock="Top">
            <TextBlock Text="現在インストールされているプラグイン" Margin="0 0 0 5" />
        </StackPanel>
        <GroupBox Header="プラグインの詳細" DockPanel.Dock="Bottom" Margin="0 10 0 0" Height="120" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="{Binding Path=View/SmallIcon}" VerticalAlignment="Center" />
                        <TextBlock Text="{Binding Path=View/Name}" VerticalAlignment="Center" Margin="2" />
                    </StackPanel>
                    <TextBlock Text="{Binding Path=View/Description}" TextWrapping="Wrap" />
                </StackPanel>
                <StackPanel Grid.Column="1" >
                    <!--<StackPanel HorizontalAlignment="Right">
                        <RadioButton Content="有効(_E)" IsChecked="{Binding Path=View/IsEnabled, Mode=TwoWay}" />
                        <RadioButton Content="無効(_D)" IsChecked="{Binding Path=View/IsEnabled, Mode=TwoWay, Converter={StaticResource NegationConverter}}" />
                    </StackPanel>-->
                    <Button Content="オプション(_O)..." 
                            Command="{Binding Path=View/EditOptionsCommand}"
                            Width="120" Margin="5 5 0 0" /> 
                </StackPanel>
            </Grid>
        </GroupBox>
        <xcdg:DataGridControl
            x:Name="PluginDataGrid"
            ReadOnly="True"
            ItemsSource="{Binding View}" 
            AutoCreateColumns="False"
            NavigationBehavior="RowOrCell"  
            ItemScrollingBehavior="Immediate"
            >

            <xcdg:DataGridControl.Columns>
                <!--<xcdg:Column FieldName="Name" x:Name="NameColumn"
                             Title="プラグイン"
                             Width="200"
                             />-->
                <xcdg:Column FieldName="IconAndTitle" x:Name="IconAndTitleColumn"
                                     ReadOnly="True"
                                     Title="プラグイン" 
                                     IsMainColumn="True"
                                     CellContentTemplate="{StaticResource PluginNameCellTemplate}"
                                     >
                    <!--<xcdg:Column.DisplayMemberBindingInfo>
                        <xcdg:DataGridBindingInfo Path="Self" ReadOnly="True" />
                    </xcdg:Column.DisplayMemberBindingInfo>-->
                </xcdg:Column>
                <xcdg:Column FieldName="IsEnabled" x:Name="EnabledColumn"
                             Title="有効"
                             Width="40"
                             ReadOnly="True"
                             CellContentTemplate="{StaticResource PluginEnabledCellTemplate}" />
            </xcdg:DataGridControl.Columns>
            <xcdg:DataGridControl.View>
                <Views:TableView UseDefaultHeadersFooters="False" IsAlternatingRowStyleEnabled="True" VerticalGridLineThickness="1" ShowRowSelectorPane="False">
                    <Views:TableView.FixedHeaders>
                        <DataTemplate>
                            <xcdg:ColumnManagerRow />
                        </DataTemplate>
                    </Views:TableView.FixedHeaders>
                </Views:TableView>
            </xcdg:DataGridControl.View>
        </xcdg:DataGridControl>

    </DockPanel>
</Page>
